package com.sky.service.impl;

import com.sky.entity.DishFlavor;
import com.sky.mapper.DishFlavorMapper;
import com.sky.service.IDishFlavorService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class DishFlavorServiceImpl implements IDishFlavorService {
    @Autowired
    private DishFlavorMapper dishFlavorMapper;

    @Override
    public void insertBatch(List<DishFlavor> flavors) {
        dishFlavorMapper.insertBatch(flavors);
    }

    @Override
    public List<DishFlavor> queryByDishId(Long id) {
        return dishFlavorMapper.getByDishId(id);
    }

    @Override
    public void deleteByDishId(Long id) {
        dishFlavorMapper.deleteByDishId(id);
    }
}
